package com.taoge.p4.common.exception;

import lombok.Data;

@Data
public class BaseException extends RuntimeException {
    private int code;
    private String msg;
    private Object data;

    public BaseException(String message) {
        this.msg = message;
    }

//    public BaseException(BaseErrorCode errorCode) {
//        this(errorCode.getCode(), errorCode.getMsg());
//    }

    public BaseException(int code, String msg) {
        this(code, msg, null);
    }

    public BaseException(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

}
